package com.cloudbroker.bcs.platform.ltb.middle.service.impl;

import com.cloudbroker.bcs.common.dao.base.DAOBase;
import com.cloudbroker.bcs.platform.ltb.middle.dao.credits.TaskConfigureDao;
import com.cloudbroker.bcs.platform.ltb.middle.entity.credits.CreditsRule;
import com.cloudbroker.bcs.platform.ltb.middle.entity.credits.TaskConfigure;
import com.cloudbroker.bcs.platform.ltb.middle.service.CreditsRuleService;
import com.cloudbroker.bcs.platform.ltb.middle.service.TaskConfigureService;
import com.cloudbroker.bcs.platform.ltb.middle.service.base.MycatServiceImplBase;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by lili19289 on 2016/11/11.
 */
@Service
public class TaskConfigureServiceImpl  extends MycatServiceImplBase implements TaskConfigureService {

    @Resource
    private TaskConfigureDao taskConfigureDao;

    @Override
    protected DAOBase getDAO() {
        return taskConfigureDao;
    }

    public TaskConfigure findByBusinessType(int business_type,String company_id){
        TaskConfigure taskConfigure = new TaskConfigure();
        taskConfigure.setBusiness_type(business_type);
        taskConfigure.setCompany_id(company_id);
        return taskConfigureDao.findByBusinessType(taskConfigure);
    }

    public TaskConfigure findByBusinessType(int business_type,int task_level,String company_id){
        TaskConfigure taskConfigure = new TaskConfigure();
        taskConfigure.setBusiness_type(business_type);
        taskConfigure.setCompany_id(company_id);
        taskConfigure.setTask_level(task_level);
        return taskConfigureDao.findByBusinessType(taskConfigure);
    }
}
